-
-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for writing arbitrary long strings in LineWriter #15
Closed
sebastianbiallas
wants to merge
1
commit into
KDE:master
from
sebastianbiallas:linewriter-long-strings
Closed
Allow for writing arbitrary long strings in LineWriter #15
sebastianbiallas
wants to merge
1
commit into
KDE:master
from
sebastianbiallas:linewriter-long-strings
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added testcase for long strings
merged, thanks! note that I extended the commit message to make it more meaningful |
catskul
pushed a commit
to catskul/heaptrack
that referenced
this pull request
Sep 29, 2020
Hopefully fixes issues such as this one: heaptrack debug(2) [8859:8859]@5830 dlopen_notify_callback: /tmp/KDevelop-5.2.1-x86_64/usr/lib/libxcb-dri2.so.0 7fd27a93d000 heaptrack debug(1) [8885:8885]@5830 child_fork() heaptrack debug(1) [8859:8859]@5831 write error 4/Interrupted system call KDE#1 0x00007fd298297f1e sp=0x00007ffe33957bd0 _ZN12_GLOBAL__N_19HeapTrack10writeErrorEv + 0x4c KDE#2 0x00007fd298297cff sp=0x00007ffe33957c00 _ZN12_GLOBAL__N_19HeapTrack24dl_iterate_phdr_callbackEP12dl_phdr_infomPv + 0x13c KDE#3 0x00007fd29123fc81 sp=0x00007ffe33957c50 dl_iterate_phdr + 0x171 KDE#4 0x00007fd298297ec1 sp=0x00007ffe33957d00 _ZN12_GLOBAL__N_19HeapTrack17updateModuleCacheEv + 0xa5 KDE#5 0x00007fd298297ae0 sp=0x00007ffe33957d20 _ZN12_GLOBAL__N_19HeapTrack12handleMallocEPvmRK5Trace + 0x54 KDE#6 0x00007fd298298805 sp=0x00007ffe33957d60 heaptrack_malloc + 0xef KDE#7 0x00007fd298295f9b sp=0x00007ffe33957fb0 malloc + 0x5f KDE#8 0x00007fd291ab6089 sp=0x00007ffe33957fe0 _Znwm + 0x19 KDE#9 0x00007fd29205cd42 sp=0x00007ffe33957ff0 _ZN7QObjectC1EPS_ + 0x22 KDE#10 0x00007fd292023374 sp=0x00007ffe33958010 _ZN8QLibraryC2ERK7QStringP7QObject + 0x14 KDE#11 0x00007fd292ef53d0 sp=0x00007ffe33958030 _ZN13KPluginLoader4loadEv + 0x60 KDE#12 0x00007fd292ef54aa sp=0x00007ffe33958090 _ZN13KPluginLoader8instanceEv + 0xa KDE#13 0x00007fd292ef54ec sp=0x00007ffe339580a0 _ZN13KPluginLoader7factoryEv + 0x1c KDE#14 0x00007fd297d4eece sp=0x00007ffe33958140 _ZN8KDevelop16PluginController18loadPluginInternalERK7QString + 0x58e KDE#15 0x00007fd297d50396 sp=0x00007ffe339582a0 _ZN8KDevelop16PluginController10initializeEv + 0x8d6 KDE#16 0x00007fd297d5ab85 sp=0x00007ffe339583f0 _ZN8KDevelop11CorePrivate10initializeENS_4Core5SetupERK7QString + 0xb95 KDE#17 0x00007fd297d5c03d sp=0x00007ffe33958490 _ZN8KDevelop4Core10initializeENS0_5SetupERK7QString + 0x5d KDE#18 0x000000000040b472 sp=0x00007ffe339584c0 main + 0x5182 KDE#19 0x00007fd29112ff4a sp=0x00007ffe339587d0 __libc_start_main + 0xea KDE#20 0x000000000040caed sp=0x00007ffe33958890 _start + 0x29 heaptrack debug(1) [8859:8859]@5858 shutdown() heaptrack debug(1) [8859:8859]@5858 destroying LockedData heaptrack debug(1) [8859:8859]@5858 done destroying LockedData heaptrack debug(1) [8859:8859]@5885 shutdown() done CCBUG: 393387
kdesysadmin
pushed a commit
that referenced
this pull request
Sep 4, 2023
Return when we get asked for invalid data which seems to happen through the KDChart attributes model. Fixes assertions/crashes like: ``` #0 0x00007fdcfc88e83c in () at /usr/lib/libc.so.6 #1 0x00007fdcfc83e668 in raise () at /usr/lib/libc.so.6 #2 0x00007fdcfc8264b8 in abort () at /usr/lib/libc.so.6 #3 0x00007fdcfd8a0098 in qt_assert(char const*, char const*, int) () at /usr/lib/libQt5Core.so.5 #4 0x00007fdcfd8a0157 in () at /usr/lib/libQt5Core.so.5 #5 0x00005649da68cf3f in QVector<QBrush>::at(int) const (this=0x6070001170a0, i=-1) at /usr/include/qt/QtCore/qvector.h:449 #6 0x00005649da70272e in ChartModel::headerData(int, Qt::Orientation, int) const (this=0x607000117060, section=-1, orientation=Qt::Horizontal, role=175763350) at /home/milian/projects/src/heaptrack/src/analyze/gui/chartmodel.cpp:69 #7 0x00007fdcfda67f5e in QAbstractProxyModel::headerData(int, Qt::Orientation, int) const () at /usr/lib/libQt5Core.so.5 #8 0x00007fdcfda7ba54 in QSortFilterProxyModel::headerData(int, Qt::Orientation, int) const () at /usr/lib/libQt5Core.so.5 #9 0x00007fdcff9b6dbf in KChart::AttributesModel::headerData(int, Qt::Orientation, int) const () at /usr/lib/libKChart.so.2 #10 0x00007fdcff9af76a in () at /usr/lib/libKChart.so.2 #11 0x00007fdcff9a7605 in KChart::AbstractDiagram::brush(int) const () at /usr/lib/libKChart.so.2 #12 0x00007fdcff9ac495 in KChart::AbstractDiagram::datasetBrushes() const () at /usr/lib/libKChart.so.2 #13 0x00007fdcff9ccd77 in () at /usr/lib/libKChart.so.2 #14 0x00007fdcff9cda4b in KChart::Legend::buildLegend() () at /usr/lib/libKChart.so.2 #15 0x00007fdcff9ce4ba in KChart::Legend::setNeedRebuild() () at /usr/lib/libKChart.so.2 #16 0x00007fdcfdad17f3 in () at /usr/lib/libQt5Core.so.5 #17 0x00007fdcff98c4f3 in KChart::DiagramObserver::diagramDataChanged(KChart::AbstractDiagram*) () at /usr/lib/libKChart.so.2 #18 0x00007fdcfdad17f3 in () at /usr/lib/libQt5Core.so.5 #19 0x00007fdcfda59182 in QAbstractItemModel::modelReset(QAbstractItemModel::QPrivateSignal) () at /usr/lib/libQt5Core.so.5 #20 0x00007fdcfda8506d in () at /usr/lib/libQt5Core.so.5 #21 0x00007fdcfdad17f3 in () at /usr/lib/libQt5Core.so.5 #22 0x00007fdcfda59182 in QAbstractItemModel::modelReset(QAbstractItemModel::QPrivateSignal) () at /usr/lib/libQt5Core.so.5 #23 0x00005649da708068 in ChartModel::resetData(ChartData const&) (this=0x607000117060, data=...) at /home/milian/projects/src/heaptrack/src/analyze/gui/chartmodel.cpp:261 #24 0x00005649da569a5d in operator()(ChartData const&) const (__closure=0x604000258e20, data=...) at /home/milian/projects/src/heaptrack/src/analyze/gui/mainwindow.cpp:223 ``` BUG: 473634
kdesysadmin
pushed a commit
that referenced
this pull request
Sep 5, 2023
When shutdown in one thread first locks the mutex, and the timer thread triggers a memory allocation, it would trigger a deadlock such as: ``` Thread 2 (Thread 0x7ffff3aeb6c0 (LWP 30899) "tst_inject"): #0 0x00007ffff6889700 in ?? () from /usr/lib/libc.so.6 #1 0x00007ffff688fec2 in pthread_mutex_lock () from /usr/lib/libc.so.6 #2 0x00007ffff3b8f089 in __gthread_mutex_lock (__mutex=0x7ffff3bffc00 <(anonymous namespace)::HeapTrack::s_lock>) at /usr/include/c++/13.2.1/x86_64-pc-linux-gnu/bits/gthr-default.h:749 #3 0x00007ffff3b8f27e in std::mutex::lock (this=0x7ffff3bffc00 <(anonymous namespace)::HeapTrack::s_lock>) at /usr/include/c++/13.2.1/bits/std_mutex.h:113 #4 0x00007ffff3b84416 in (anonymous namespace)::HeapTrack::HeapTrack (this=0x7ffff3aea6e0) at /home/milian/projects/src/heaptrack/src/track/libheaptrack.cpp:263 #5 0x00007ffff3b8940b in heaptrack_realloc_impl (ptr_in=0x0, size=32, ptr_out=0x603000001810) at /home/milian/projects/src/heaptrack/src/track/libheaptrack.cpp:804 #6 0x00007ffff3b89f06 in heaptrack_realloc2 (ptr_in=0, size=32, ptr_out=105759274702864) at /home/milian/projects/src/heaptrack/src/track/libheaptrack.cpp:886 #7 0x00007ffff3b6c48c in (anonymous namespace)::hooks::realloc::hook (ptr=0x0, size=32) at /home/milian/projects/src/heaptrack/src/track/heaptrack_inject.cpp:140 #8 0x00007ffff688de8b in pthread_getattr_np () from /usr/lib/libc.so.6 #9 0x00007ffff79015a1 in __sanitizer::GetThreadStackTopAndBottom (at_initialization=at_initialization@entry=false, stack_top=stack_top@entry=0x7ffff3aeabd8, stack_bottom=stack_bottom@entry=0x7ffff3aeabe0) at /usr/src/debug/gcc/gcc/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp:150 #10 0x00007ffff79017ca in __sanitizer::GetThreadStackAndTls (main=false, stk_addr=0x7ffff7705020, stk_size=0x7ffff3aeac30, tls_addr=0x7ffff7705040, tls_size=0x7ffff3aeac28) at /usr/src/debug/gcc/gcc/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp:598 #11 0x00007ffff78f0ff4 in __asan::AsanThread::SetThreadStackAndTls (this=this@entry=0x7ffff7705000, options=<optimized out>) at /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_thread.h:77 #12 0x00007ffff78f14ee in __asan::AsanThread::Init (this=this@entry=0x7ffff7705000, options=options@entry=0x0) at /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_thread.cpp:234 #13 0x00007ffff78f19e5 in __asan::AsanThread::ThreadStart (this=0x7ffff7705000, os_id=30899) at /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_thread.cpp:264 #14 0x00007ffff688c9eb in ?? () from /usr/lib/libc.so.6 #15 0x00007ffff6910dfc in ?? () from /usr/lib/libc.so.6 Thread 1 (Thread 0x7ffff7f19980 (LWP 30896) "tst_inject"): #0 0x00007ffff68894ae in ?? () from /usr/lib/libc.so.6 #1 0x00007ffff688e5f3 in ?? () from /usr/lib/libc.so.6 #2 0x00007ffff74e19b8 in __gthread_join (__value_ptr=0x0, __threadid=<optimized out>) at /usr/src/debug/gcc/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:669 #3 std::thread::join (this=0x608000000270) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:134 #4 0x00007ffff3b88dde in (anonymous namespace)::HeapTrack::LockedData::~LockedData (this=0x608000000220, __in_chrg=<optimized out>) at /home/milian/projects/src/heaptrack/src/track/libheaptrack.cpp:739 #5 0x00007ffff3b84c08 in (anonymous namespace)::HeapTrack::shutdown (this=0x7ffff4916540) at /home/milian/projects/src/heaptrack/src/track/libheaptrack.cpp:359 --Type <RET> for more, q to quit, c to continue without paging-- #6 0x00007ffff3b8984e in heaptrack_stop () at /home/milian/projects/src/heaptrack/src/track/libheaptrack.cpp:839 #7 0x0000555555799eb7 in (anonymous namespace)::runInjectTest<DOCTEST_ANON_FUNC_14()::<lambda()>, DOCTEST_ANON_FUNC_14()::<lambda(void*)> >(struct {...}, struct {...}) (load=..., unload=...) at /home/milian/projects/src/heaptrack/tests/auto/no_asan/tst_inject.cpp:64 #8 0x00005555557938ba in DOCTEST_ANON_FUNC_14 () at /home/milian/projects/src/heaptrack/tests/auto/no_asan/tst_inject.cpp:80 #9 0x000055555578fb16 in doctest::Context::run (this=0x7ffff4800420) at /home/milian/projects/src/heaptrack/tests/auto/../../3rdparty/doctest.h:7013 #10 0x00005555557935ff in main (argc=1, argv=0x7fffffffc628) at /home/milian/projects/src/heaptrack/tests/auto/../../3rdparty/doctest.h:7091 (gdb) ``` To prevent this from happening, we now give up on trying to lock the mutex when we are shutting down.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.